import 'package:book_app/feature/loginregister/service/register_service.dart';
import 'package:flutter/material.dart';
import 'package:mobx/mobx.dart';

import '../../../product/base/base_view_model.dart';
import '../service/login_service.dart';


class RegisterViewModel with Store, BaseViewModel, ChangeNotifier {
  @override
  void setContext(BuildContext context) => viewModelContext = context;

  @override
  void init() {}
  bool isLoading = false;
  final RegisterService _loginService = RegisterService();

  Future<void> fetchBookCategories() async {
    isLoading = true;
    notifyListeners();
    try {
      // categories = await _categoryService.fetchBookCategories();
    } catch (e) {
      return print('Failed to fetch trending books: $e');
    }

    isLoading = false;
    notifyListeners();
  }

  Future<void> fetchBooksByCategory(String category) async {
    isLoading = true;
    notifyListeners();

    try {
      // books = await _categoryService.fetchBooksByCategory(category);
    } catch (e) {
      return print('Failed to fetch trending books: $e');
    }

    isLoading = false;
    notifyListeners();
  }
}

